/*
	File: data/scripts/scene_item-deactivation.nut
	Author: GameStart3d.com
*/

/*!
	@short	SceneItemDeactivation
	@author	GameStart3d.com
*/
class	SceneItemDeactivation
{
	item_list		=	0
	update_count	=	0
	activation_flag	=	false

	/*!
		@short	OnUpdate
		Called each frame.
	*/
	function	OnUpdate(scene)
	{
		update_count++
		if (update_count > 120)
		{
			foreach(item in item_list)
				SceneItemActivate(scene, item, activation_flag)
			update_count = 0
			activation_flag = !activation_flag
		}
	}

	/*!
		@short	OnSetup
		Called when the scene is about to be setup.
	*/
	function	OnSetup(scene)
	{
		item_list = []
		local	_list = SceneGetItemList(scene)

		foreach(item in _list)
		{
			if (ItemGetName(item) == "Cube")
				item_list.append(item)
		}
		
	}
}
